package pen_exam.meituan_2024_03_16;

import java.util.Scanner;

//算术题
public class Class02_Sum {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] nq = sc.nextLine().split(" ");
        int n = Integer.parseInt(nq[0]);
        int q = Integer.parseInt(nq[1]);
        String[] s = sc.nextLine().split(" ");
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(s[i]);
        }
        int[] exec = new int[q];
        for (int i = 0; i < q; i++) {
            exec[i] = Integer.parseInt(sc.nextLine()) - 1;
        }
        System.out.println(sum2(arr, exec));
        ;
    }

    public static int sum2(int[] arr, int[] exec) {
        int sum = 0;
        for (int j : arr) {
            sum += j;
        }
        sum *= 2;
        int len = exec.length;
        for (int j : exec) {
            sum -= arr[j];
        }
        sum = (int) ((sum  * Math.pow(2, len - 1)) % 1000000007 );
        return sum;
    }


    public static long sum(int[] arr, int[] exec) {
        int n = arr.length;
        long[] pre = new long[n + 1];
        for (int i = 1; i <= n; i++) {
            pre[i] = pre[i - 1] + arr[i - 1];
        }
        for (int num : exec) {
            for (int i = 1; i < num + 1; i++) {
                arr[i - 1] *= 2;
                pre[i] *= 2;
            }
            pre[num + 1] = pre[num] + arr[num];
            for (int i = num + 2; i <= n; i++) {
                arr[i - 1] *= 2;
                pre[i] = (pre[i] * 2) - arr[num];
            }
        }
        return pre[n] % 1000000007;
    }
}
